<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Notas
 *
 * @author MFerreira
 * @export Modules
 * @export-metadata category:Cursos:Mis Notas
 * @export-metadata RequiredRoles:ROLE_STUDENT
 */
class Notas extends Module {

    public function index() {

        Loader::using("models::entities::PeriodoAcademico");

        $codigo = $this->currentUser->getName();
        $periodos = $this->model->students->GetPeriodos($codigo);

        $indexPeriodo = $this->request->post("IndexPeriodo", count($periodos) - 1);

        $cursos = $this->model->registeredCourse->GetByEstudianteAndPeriodoAcademico($codigo, $periodos[$indexPeriodo]);

        $this->assign("cursos", $cursos);
        $this->assign("periodos", $periodos);
        $this->assign("indexPeriodo", $indexPeriodo);
        $this->assign("action", $this->route->action("index"));

        $this->display();
    }

}

?>
